package com.lylg.picture_share.service.impl;

import com.lylg.picture_share.dao.CollectMapper;
import com.lylg.picture_share.dao.GoodMapper;
import com.lylg.picture_share.entity.Collect;
import com.lylg.picture_share.entity.Good;
import com.lylg.picture_share.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class GoodServiceImpl implements GoodService {
    @Autowired
    private GoodMapper goodMapper;


    @Override
    public Good getGoodImageByUser(Good good) {
        return goodMapper.selectGoodImageByUser(good);
    }

    @Override
    public void cancelGood(Good good) {
        goodMapper.deleteGood(good);

    }

    @Override
    public void doGood(Good good) {
        goodMapper.insertGood(good);

    }
}
